//
//  XWeixinHelper.h
//  XWeixinSDK_Example
//
//  Created by 吴智民 on 2019/11/9.
//  Copyright © 2019 lanchc. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

#import "WXApi.h"
#import "XWeixinSharedDelegate.h"
#import "XWeixinAuthorizeDelegate.h"

NS_ASSUME_NONNULL_BEGIN

@interface XWeixinHelper : NSObject


+ (instancetype)shared;

/// 配置参数
/// @param appId 应用id
/// @param secretId 应用密匙
+(void)configure:(NSString*)appId secret:(NSString*)secretId;
/// 新版本注册
+(void)configure:(NSString*)appId secret:(NSString*)secretId link:(NSString *)universalLink;

/// 配置参数
/// @param authScope 申请权限
+(void)configure:(NSString*)authScope;

// MARK: - 业务方法
/** 发起微信登录 */
- (void)Authorize:(UIViewController<XWeixinAuthorizeDelegate> *)delegate;
/** 统一码 */
- (void)unicode:(NSString*)openId controller:(UIViewController<XWeixinAuthorizeDelegate>* )delegate;

/** 分享图片 */
- (void)shared:(NSData *)image
      subtitle:(NSString *)subtitle
         thumb:(UIImage *)thumb
         scene:(enum WXScene)scene
        target:(id<XWeixinSharedDelegate>)delegate;

/** 分享URL */
- (void)shared:(NSString *)url
      subtitle:(NSString *)subtitle
      detailed:(NSString *)detailed
         thumb:(UIImage *)thumbImage
         scene:(enum WXScene)scene
        target:(id<XWeixinSharedDelegate>)delegate;


// MARK: - 工具方法

/// 检查是否安装微信
+ (BOOL)isInstalled;
 
/// 处理微信通过URL启动App时传递回来的数据
+ (BOOL)handleOpenURL:(NSURL *)url;
/// 处理微信通过Universal Link启动App时传递的数据
+ (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity;

@end

NS_ASSUME_NONNULL_END



